<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>CAD-Tool: /home/manish/Desktop/Manish_CAD_Tool/src/planar_graph_generator.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CAD-Tool
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">planar_graph_generator.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="planar__graph__generator_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="planar__graph__generator_8h.html">include/planar_graph_generator.h</a>&quot;</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="general__methods_8h.html">include/general_methods.h</a>&quot;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include&lt;iostream&gt;</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;</div><div class="line"><a name="l00005"></a><span class="lineno"><a class="line" href="planar__graph__generator_8cpp.html#a06b50f1ca7258a9862c39d3ed354bf7c">    5</a></span>&#160;<span class="preprocessor">#define epsilon 0.000001</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno"><a class="line" href="planar__graph__generator_8cpp.html#a2cdfdb8be2237b1c7359b630e9603cfd">    8</a></span>&#160;    std::vector&lt; Full_plane &gt; <a class="code" href="planar__graph__generator_8cpp.html#a2cdfdb8be2237b1c7359b630e9603cfd">planar_graph_generator</a>(std::vector&lt;vertex_3d&gt; v3d_list,</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;        std::vector&lt;edge_3d&gt; &amp;e3d_list){</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;        std::vector&lt; std::vector&lt;int&gt; &gt; adj_list = <a class="code" href="planar__graph__generator_8cpp.html#a077660a929dda9adf2f8a2daa6a563c1">get_adj_list</a>(e3d_list, v3d_list.size());</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;        std::vector&lt;plane&gt; planes_list = <a class="code" href="planar__graph__generator_8cpp.html#a8d89f969b47445ac1b5b0cf170401cf1">construct_planes</a>(v3d_list, e3d_list, adj_list);</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;        planes_list =  <a class="code" href="planar__graph__generator_8cpp.html#a488a27459d11af0b73b76ebe78a8a1c4">eliminate_duplicate_planes</a>(planes_list);</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;        std::vector&lt; Full_plane &gt; ans;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i&lt;planes_list.size(); i++){</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;            <a class="code" href="class_full__plane.html">Full_plane</a> f1(planes_list[i], v3d_list, e3d_list);</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;            <span class="keywordflow">if</span>(<a class="code" href="planar__graph__generator_8cpp.html#acd37db477f3dd31a46790f5a7ded851c">check_legality</a>(f1,adj_list))</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;                ans.push_back(f1);</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;        }</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;        <a class="code" href="planar__graph__generator_8cpp.html#ad4d8aa255999d941dcc6b5b61ca9d0fd">remove_single_plane_edges</a>(ans,e3d_list);</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;        <span class="keywordflow">return</span> ans;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    }</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="planar__graph__generator_8cpp.html#a8d89f969b47445ac1b5b0cf170401cf1">   27</a></span>&#160;    std::vector&lt; plane &gt; <a class="code" href="planar__graph__generator_8cpp.html#a8d89f969b47445ac1b5b0cf170401cf1">construct_planes</a>(std::vector&lt;vertex_3d&gt; v3d_list,</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;        std::vector&lt;edge_3d&gt; e3d_list, std::vector&lt; std::vector&lt;int&gt; &gt; adj_list){</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;        std::vector&lt;plane&gt; planes_list;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i&lt;adj_list.size(); i++){</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;            <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=0; j&lt;adj_list[i].size(); j++){</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;                <span class="keywordflow">for</span>(<span class="keywordtype">int</span> k=j+1; k&lt;adj_list[i].size(); k++){</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;                    <span class="keywordtype">int</span> p1,p2; p1= adj_list[i][j];</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;                    p2= adj_list[i][k]; <a class="code" href="classvertex__3d.html">vertex_3d</a> v1,v2;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;                    v1 = v3d_list[i]; v1.<a class="code" href="classvertex__3d.html#ab3b7d3a3201f4d9a4da75b5b1c379ac1">shift_it</a>(v3d_list[p1]);</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;                    v2 = v3d_list[i]; v2.<a class="code" href="classvertex__3d.html#ab3b7d3a3201f4d9a4da75b5b1c379ac1">shift_it</a>(v3d_list[p2]);</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;                    v1 = <a class="code" href="general__methods_8h.html#a2dc9a47107e3f17fb944f6077f942236">cross_product</a>(v1,v2);</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;                    v2 = v3d_list[p2];</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;                    <span class="keywordtype">float</span> d = <a class="code" href="general__methods_8h.html#adde63ba9542357791cc6a967f2ea582e">dot_product</a>(v1,v2);</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;                    planes_list.push_back(<a class="code" href="classplane.html">plane</a> (v1.<a class="code" href="classvertex__3d.html#a3f42c81ecbe6cab86cda63854c7799c8">x</a>,v1.<a class="code" href="classvertex__3d.html#a44d8a3570860630dc76bfa0817786a9b">y</a>,v1.<a class="code" href="classvertex__3d.html#a9028d1e6317552f63d6cbd57ff5a42ba">z</a>,d));</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;                }</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;            }</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        }</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        <span class="keywordflow">return</span> planes_list;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    }</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="planar__graph__generator_8cpp.html#a077660a929dda9adf2f8a2daa6a563c1">   49</a></span>&#160;    std::vector&lt; std::vector&lt;int&gt; &gt; <a class="code" href="planar__graph__generator_8cpp.html#a077660a929dda9adf2f8a2daa6a563c1">get_adj_list</a>(std::vector&lt;edge_3d&gt; e3d_list, <span class="keywordtype">int</span> no_of_vertices){</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        std::vector&lt; std::vector&lt;int&gt; &gt; v(no_of_vertices);</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        <span class="keywordflow">for</span>(<span class="keyword">auto</span> z : e3d_list)</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;            v[z.f].push_back(z.s), v[z.s].push_back(z.f);</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        <span class="keywordflow">return</span> v;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    }</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="planar__graph__generator_8cpp.html#a488a27459d11af0b73b76ebe78a8a1c4">   57</a></span>&#160;    std::vector&lt; plane &gt; <a class="code" href="planar__graph__generator_8cpp.html#a488a27459d11af0b73b76ebe78a8a1c4">eliminate_duplicate_planes</a>(std::vector&lt; plane &gt; planes){</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        <span class="keywordtype">int</span> n = planes.size();</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        std::vector&lt;bool&gt; useful(n,<span class="keyword">true</span>);</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i&lt;n;i++){</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;            <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=i+1;j&lt;n;j++){</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;                <span class="comment">// condition</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;                <span class="keywordtype">float</span> diff,a,b,c,d;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;                a = planes[i].a - planes[j].a;</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;                b = planes[i].b - planes[j].b;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;                c = planes[i].c - planes[j].c;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;                d = planes[i].d - planes[j].d;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;                diff = a*a + b*b + c*c + d*d;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;                <span class="keywordflow">if</span>(diff &lt; <a class="code" href="planar__graph__generator_8cpp.html#a06b50f1ca7258a9862c39d3ed354bf7c">epsilon</a>)</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;                    {useful[i]=<span class="keyword">false</span>; <span class="keywordflow">break</span>;}</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;            }</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        }</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        std::vector&lt;plane&gt; ans;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i&lt;n;i++)</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;            <span class="keywordflow">if</span>(useful[i]) ans.push_back(planes[i]);</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <span class="keywordflow">return</span> ans;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    }</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="planar__graph__generator_8cpp.html#acd37db477f3dd31a46790f5a7ded851c">   80</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="planar__graph__generator_8cpp.html#acd37db477f3dd31a46790f5a7ded851c">check_legality</a>(<a class="code" href="class_full__plane.html">Full_plane</a> &amp;f, std::vector&lt; std::vector&lt;int&gt; &gt; adj_list){</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <span class="keywordflow">if</span>(f.<a class="code" href="class_full__plane.html#a88e6924e5ae6ef5ed92611ff849be290">edges_on_it</a>.size() &lt;= 2) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        <a class="code" href="planar__graph__generator_8cpp.html#a47eedebb44f45567710e54702a5f28b6">remove_dangling</a>(f, adj_list);</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        <span class="keywordflow">if</span>(f.<a class="code" href="class_full__plane.html#a88e6924e5ae6ef5ed92611ff849be290">edges_on_it</a>.size() == 0)</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    }</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="planar__graph__generator_8cpp.html#a47eedebb44f45567710e54702a5f28b6">   90</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="planar__graph__generator_8cpp.html#a47eedebb44f45567710e54702a5f28b6">remove_dangling</a>(<a class="code" href="class_full__plane.html">Full_plane</a> &amp;f, std::vector&lt; std::vector&lt;int&gt; &gt; adj_list){</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        <span class="keywordtype">bool</span> end_it;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        <span class="keywordflow">while</span>(<span class="keyword">true</span>)</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        {</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;            end_it=<span class="keyword">true</span>;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;            <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=0; j&lt;f.<a class="code" href="class_full__plane.html#a0b93d1b5a72f3fb83808edfce3bbcd1b">vertices_on_it</a>.size(); j++){</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;                <span class="keywordtype">int</span> cnt=0; <span class="keywordtype">int</span> z = f.<a class="code" href="class_full__plane.html#a0b93d1b5a72f3fb83808edfce3bbcd1b">vertices_on_it</a>[j];</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;                <span class="keywordflow">for</span>(<span class="keyword">auto</span> zz : adj_list[z]){</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;                    <span class="keywordflow">for</span>(<span class="keyword">auto</span> y : f.<a class="code" href="class_full__plane.html#a0b93d1b5a72f3fb83808edfce3bbcd1b">vertices_on_it</a>){</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;                        <span class="keywordflow">if</span>(zz == y) {cnt++; <span class="keywordflow">break</span>;}</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;                    }</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;                }</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;                <span class="keywordflow">if</span>(cnt &lt; 2){</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;                    f.<a class="code" href="class_full__plane.html#a0b93d1b5a72f3fb83808edfce3bbcd1b">vertices_on_it</a>.erase(f.<a class="code" href="class_full__plane.html#a0b93d1b5a72f3fb83808edfce3bbcd1b">vertices_on_it</a>.begin()+j);</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;                    j--;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;                    end_it = <span class="keyword">false</span>;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;                }</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;            }</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;            <span class="keywordflow">if</span>(end_it) <span class="keywordflow">break</span>;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        }</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=0; j&lt;f.<a class="code" href="class_full__plane.html#a88e6924e5ae6ef5ed92611ff849be290">edges_on_it</a>.size(); j++){</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;            <span class="keywordtype">int</span> k,l; k = f.<a class="code" href="class_full__plane.html#a88e6924e5ae6ef5ed92611ff849be290">edges_on_it</a>[j].f; l = f.<a class="code" href="class_full__plane.html#a88e6924e5ae6ef5ed92611ff849be290">edges_on_it</a>[j].s;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;            <span class="keywordtype">bool</span> k1,l1; k1=l1= <span class="keyword">false</span>;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;            <span class="keywordflow">for</span>(<span class="keyword">auto</span> z : f.<a class="code" href="class_full__plane.html#a0b93d1b5a72f3fb83808edfce3bbcd1b">vertices_on_it</a>){</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;                <span class="keywordflow">if</span>(z == k) k1 = <span class="keyword">true</span>;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;                <span class="keywordflow">if</span>(z == l) l1 = <span class="keyword">true</span>;</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;            }</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;            <span class="keywordflow">if</span>(!(k1 &amp;&amp; l1)) f.<a class="code" href="class_full__plane.html#a88e6924e5ae6ef5ed92611ff849be290">edges_on_it</a>.erase(f.<a class="code" href="class_full__plane.html#a88e6924e5ae6ef5ed92611ff849be290">edges_on_it</a>.begin()+j), j--;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;        }</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    }</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno"><a class="line" href="planar__graph__generator_8cpp.html#ad4d8aa255999d941dcc6b5b61ca9d0fd">  121</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="planar__graph__generator_8cpp.html#ad4d8aa255999d941dcc6b5b61ca9d0fd">remove_single_plane_edges</a>(std::vector&lt;Full_plane &gt; &amp;f_list, std::vector&lt;edge_3d&gt; &amp;e3d_list)</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    {</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        std::vector&lt;int&gt; remove_these;</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i&lt;e3d_list.size(); i++)</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        {</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;            <span class="keywordtype">int</span> cnt = 0;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;            <span class="keywordflow">for</span>(<span class="keyword">auto</span> z : f_list)</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;            {</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;                <span class="keywordtype">int</span> j=0;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;                <span class="keywordflow">for</span>(<span class="keyword">auto</span> zz : z.edges_on_it)</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;                {</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;                    <span class="keywordflow">if</span>(zz == e3d_list[i])</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;                        cnt++;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;                    j++;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;                }</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;            }</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;            <span class="keywordflow">if</span>(cnt &lt; 2){</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;                remove_these.push_back(i);</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;                <span class="keywordtype">int</span> ple=0;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;                <span class="keywordflow">for</span>(<span class="keyword">auto</span> z : f_list){</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;                    <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=z.edges_on_it.size()-1; j&gt;=0;j--){</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;                        <span class="keywordflow">if</span>(e3d_list[i] == z.edges_on_it[j])</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;                        {</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;                            f_list[ple].edges_on_it.erase(f_list[ple].edges_on_it.begin()+j);</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;                        }</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;                    }</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;                    ple++;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;                }</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;            }</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        }</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=remove_these.size()-1 ; i&gt;=0; i--)</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        {</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;            e3d_list.erase(e3d_list.begin()+remove_these[i]);</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        }</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    }</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;</div><div class="ttc" id="planar__graph__generator_8cpp_html_a8d89f969b47445ac1b5b0cf170401cf1"><div class="ttname"><a href="planar__graph__generator_8cpp.html#a8d89f969b47445ac1b5b0cf170401cf1">construct_planes</a></div><div class="ttdeci">std::vector&lt; plane &gt; construct_planes(std::vector&lt; vertex_3d &gt; v3d_list, std::vector&lt; edge_3d &gt; e3d_list, std::vector&lt; std::vector&lt; int &gt; &gt; adj_list)</div><div class="ttdoc">function that constructs plane equations </div><div class="ttdef"><b>Definition:</b> <a href="planar__graph__generator_8cpp_source.html#l00027">planar_graph_generator.cpp:27</a></div></div>
<div class="ttc" id="planar__graph__generator_8cpp_html_a06b50f1ca7258a9862c39d3ed354bf7c"><div class="ttname"><a href="planar__graph__generator_8cpp.html#a06b50f1ca7258a9862c39d3ed354bf7c">epsilon</a></div><div class="ttdeci">#define epsilon</div><div class="ttdef"><b>Definition:</b> <a href="planar__graph__generator_8cpp_source.html#l00005">planar_graph_generator.cpp:5</a></div></div>
<div class="ttc" id="planar__graph__generator_8cpp_html_a2cdfdb8be2237b1c7359b630e9603cfd"><div class="ttname"><a href="planar__graph__generator_8cpp.html#a2cdfdb8be2237b1c7359b630e9603cfd">planar_graph_generator</a></div><div class="ttdeci">std::vector&lt; Full_plane &gt; planar_graph_generator(std::vector&lt; vertex_3d &gt; v3d_list, std::vector&lt; edge_3d &gt; &amp;e3d_list)</div><div class="ttdoc">function that generates and retunrs planes </div><div class="ttdef"><b>Definition:</b> <a href="planar__graph__generator_8cpp_source.html#l00008">planar_graph_generator.cpp:8</a></div></div>
<div class="ttc" id="planar__graph__generator_8cpp_html_a077660a929dda9adf2f8a2daa6a563c1"><div class="ttname"><a href="planar__graph__generator_8cpp.html#a077660a929dda9adf2f8a2daa6a563c1">get_adj_list</a></div><div class="ttdeci">std::vector&lt; std::vector&lt; int &gt; &gt; get_adj_list(std::vector&lt; edge_3d &gt; e3d_list, int no_of_vertices)</div><div class="ttdoc">function that returns adjacency edges list of the vertex_3d list </div><div class="ttdef"><b>Definition:</b> <a href="planar__graph__generator_8cpp_source.html#l00049">planar_graph_generator.cpp:49</a></div></div>
<div class="ttc" id="classvertex__3d_html"><div class="ttname"><a href="classvertex__3d.html">vertex_3d</a></div><div class="ttdoc">class for a vertex_3d </div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00064">structs.h:64</a></div></div>
<div class="ttc" id="classvertex__3d_html_a44d8a3570860630dc76bfa0817786a9b"><div class="ttname"><a href="classvertex__3d.html#a44d8a3570860630dc76bfa0817786a9b">vertex_3d::y</a></div><div class="ttdeci">float y</div><div class="ttdoc">y-coordinate of the vertex </div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00067">structs.h:67</a></div></div>
<div class="ttc" id="classvertex__3d_html_a9028d1e6317552f63d6cbd57ff5a42ba"><div class="ttname"><a href="classvertex__3d.html#a9028d1e6317552f63d6cbd57ff5a42ba">vertex_3d::z</a></div><div class="ttdeci">float z</div><div class="ttdoc">z-coordinate of the vertex </div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00068">structs.h:68</a></div></div>
<div class="ttc" id="class_full__plane_html_a0b93d1b5a72f3fb83808edfce3bbcd1b"><div class="ttname"><a href="class_full__plane.html#a0b93d1b5a72f3fb83808edfce3bbcd1b">Full_plane::vertices_on_it</a></div><div class="ttdeci">std::vector&lt; int &gt; vertices_on_it</div><div class="ttdoc">vector of enum of vertices which are on this plane </div><div class="ttdef"><b>Definition:</b> <a href="_full__plane_8h_source.html#l00018">Full_plane.h:18</a></div></div>
<div class="ttc" id="classplane_html"><div class="ttname"><a href="classplane.html">plane</a></div><div class="ttdoc">class for a plane plane represented as (a,b,c,d) corresponding to the equation ax + by + cz = d ...</div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00113">structs.h:113</a></div></div>
<div class="ttc" id="classvertex__3d_html_a3f42c81ecbe6cab86cda63854c7799c8"><div class="ttname"><a href="classvertex__3d.html#a3f42c81ecbe6cab86cda63854c7799c8">vertex_3d::x</a></div><div class="ttdeci">float x</div><div class="ttdoc">x-coordinate of the vertex </div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00066">structs.h:66</a></div></div>
<div class="ttc" id="general__methods_8h_html_a2dc9a47107e3f17fb944f6077f942236"><div class="ttname"><a href="general__methods_8h.html#a2dc9a47107e3f17fb944f6077f942236">cross_product</a></div><div class="ttdeci">vertex_3d cross_product(vertex_3d a, vertex_3d b)</div><div class="ttdef"><b>Definition:</b> <a href="general__methods_8cpp_source.html#l00005">general_methods.cpp:5</a></div></div>
<div class="ttc" id="planar__graph__generator_8cpp_html_acd37db477f3dd31a46790f5a7ded851c"><div class="ttname"><a href="planar__graph__generator_8cpp.html#acd37db477f3dd31a46790f5a7ded851c">check_legality</a></div><div class="ttdeci">bool check_legality(Full_plane &amp;f, std::vector&lt; std::vector&lt; int &gt; &gt; adj_list)</div><div class="ttdoc">function returns true if planar graph is legal </div><div class="ttdef"><b>Definition:</b> <a href="planar__graph__generator_8cpp_source.html#l00080">planar_graph_generator.cpp:80</a></div></div>
<div class="ttc" id="planar__graph__generator_8cpp_html_a488a27459d11af0b73b76ebe78a8a1c4"><div class="ttname"><a href="planar__graph__generator_8cpp.html#a488a27459d11af0b73b76ebe78a8a1c4">eliminate_duplicate_planes</a></div><div class="ttdeci">std::vector&lt; plane &gt; eliminate_duplicate_planes(std::vector&lt; plane &gt; planes)</div><div class="ttdoc">function that eliminates duplicate formed planes </div><div class="ttdef"><b>Definition:</b> <a href="planar__graph__generator_8cpp_source.html#l00057">planar_graph_generator.cpp:57</a></div></div>
<div class="ttc" id="general__methods_8h_html"><div class="ttname"><a href="general__methods_8h.html">general_methods.h</a></div></div>
<div class="ttc" id="classvertex__3d_html_ab3b7d3a3201f4d9a4da75b5b1c379ac1"><div class="ttname"><a href="classvertex__3d.html#ab3b7d3a3201f4d9a4da75b5b1c379ac1">vertex_3d::shift_it</a></div><div class="ttdeci">void shift_it(vertex_3d ref_vertex)</div><div class="ttdoc">function to shift a vertex wrt to a reference vertex </div><div class="ttdef"><b>Definition:</b> <a href="structs_8cpp_source.html#l00077">structs.cpp:77</a></div></div>
<div class="ttc" id="class_full__plane_html_a88e6924e5ae6ef5ed92611ff849be290"><div class="ttname"><a href="class_full__plane.html#a88e6924e5ae6ef5ed92611ff849be290">Full_plane::edges_on_it</a></div><div class="ttdeci">std::vector&lt; edge_3d &gt; edges_on_it</div><div class="ttdoc">vector of edges which are on this plane </div><div class="ttdef"><b>Definition:</b> <a href="_full__plane_8h_source.html#l00020">Full_plane.h:20</a></div></div>
<div class="ttc" id="class_full__plane_html"><div class="ttname"><a href="class_full__plane.html">Full_plane</a></div><div class="ttdef"><b>Definition:</b> <a href="_full__plane_8h_source.html#l00014">Full_plane.h:14</a></div></div>
<div class="ttc" id="planar__graph__generator_8cpp_html_ad4d8aa255999d941dcc6b5b61ca9d0fd"><div class="ttname"><a href="planar__graph__generator_8cpp.html#ad4d8aa255999d941dcc6b5b61ca9d0fd">remove_single_plane_edges</a></div><div class="ttdeci">void remove_single_plane_edges(std::vector&lt; Full_plane &gt; &amp;f_list, std::vector&lt; edge_3d &gt; &amp;e3d_list)</div><div class="ttdoc">function that removes those edges which belongs only to one planner graph </div><div class="ttdef"><b>Definition:</b> <a href="planar__graph__generator_8cpp_source.html#l00121">planar_graph_generator.cpp:121</a></div></div>
<div class="ttc" id="general__methods_8h_html_adde63ba9542357791cc6a967f2ea582e"><div class="ttname"><a href="general__methods_8h.html#adde63ba9542357791cc6a967f2ea582e">dot_product</a></div><div class="ttdeci">float dot_product(vertex_3d a, vertex_3d b)</div><div class="ttdef"><b>Definition:</b> <a href="general__methods_8cpp_source.html#l00017">general_methods.cpp:17</a></div></div>
<div class="ttc" id="planar__graph__generator_8cpp_html_a47eedebb44f45567710e54702a5f28b6"><div class="ttname"><a href="planar__graph__generator_8cpp.html#a47eedebb44f45567710e54702a5f28b6">remove_dangling</a></div><div class="ttdeci">void remove_dangling(Full_plane &amp;f, std::vector&lt; std::vector&lt; int &gt; &gt; adj_list)</div><div class="ttdoc">function that removes dangling and isolated edges on the planar graph using dfs </div><div class="ttdef"><b>Definition:</b> <a href="planar__graph__generator_8cpp_source.html#l00090">planar_graph_generator.cpp:90</a></div></div>
<div class="ttc" id="planar__graph__generator_8h_html"><div class="ttname"><a href="planar__graph__generator_8h.html">planar_graph_generator.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
